<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>katana.min.css" />
<?php if($theme->getBootstrap() > 0): ?>
    <?php 
	if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/bootstrap/css/bootstrap.min.css'))
	{ ?><link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/bootstrap/css/bootstrap.min.css" /><?php }
	else
	{ 
		if($theme->getBootstrapURL())
		{ ?><link href="<?php echo $theme->getBootstrapURL(); ?>" rel="stylesheet"><?php }
		else
		{
			if($theme->getBootstrap() > 2)
			{ ?><link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/3.1.0/css/bootstrap.min.css" /><?php }
			else
			{ ?><link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/css/bootstrap.min.css" /><?php }
		}
	}
	if($theme->getBootstrapThemeURL())
	{ ?><link href="<?php echo $theme->getBootstrapThemeURL(); ?>" rel="stylesheet"><?php }
	if(ICONS_LARGE != '')
	{ 
		if(file_exists(TEMPLATES_CORE_PATH.'icons/'.ICONS_LARGE.'/include.php'))
		{ include(TEMPLATES_CORE_PATH.'icons/'.ICONS_LARGE.'/include.php'); }
	}
	?>
    <?php if($theme->getBootstrap() < 3): ?>
    <link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/katana.bs2.min.css" />
    <?php endif; ?>
    <?php 
	if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/bootstrap/css/bootstrap-theme.min.css'))
	{ ?><link rel="stylesheet" type="text/css" href="/templates/themes/<?php echo $theme->getId(); ?>/bootstrap/css/bootstrap-theme.min.css" /><?php }
	else
	{
		if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/bootstrap/css/bootstrap-theme.css'))
		{ ?><link rel="stylesheet" type="text/css" href="/templates/themes/<?php echo $theme->getId(); ?>/bootstrap/css/bootstrap-theme.css" /><?php }
	}
	?>
<?php else: ?>
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>bootstrap/light/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>katana.input.min.css" />
<?php endif; ?>
<?php if($_REQUEST['print'] != ''): ?>
	<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/print.css')): ?>
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/print.css"/>
	<?php else: ?>
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>print.css"/>
	<?php endif; ?>
<?php else: ?>
	<?php if(($theme->getGridSystem() > 0) && ($theme->getBootstrap() == 0)): ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/grid.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/grid.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>960.css" />
		<?php endif; ?>
	<?php endif; ?>
	<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/theme.min.css')): ?>
	<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/theme.min.css"/>
	<?php else: ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/theme.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/theme.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/modules.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/modules.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/headers.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/headers.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>headers/headers.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/footers.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/footers.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>footers/footers.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/buttons.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/buttons.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>buttons/buttons.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/borders.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/borders.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>borders/borders.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/menu.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/menu.css"/>
		<?php else: ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_CORE_URL; ?>headers/headers.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/components.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/components.css"/>
		<?php endif; ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/typography.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/typography.css"/>
		<?php endif; ?>
	<?php endif; ?>
	<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/custom.css')): ?>
	<link rel="stylesheet" type="text/css" href="/templates/themes/<?php echo $theme->getId(); ?>/custom.css?<?php echo date('dh'); ?>"/>
	<?php endif; ?>
	<?php if(defined('RUN_IFRAME')): ?>
		<?php if(file_exists(TEMPLATES_PATH.'themes/'.$theme->getId().'/iframe.css')): ?>
		<link rel="stylesheet" type="text/css" href="<?php echo TEMPLATES_URL; ?>themes/<?php echo $theme->getId(); ?>/iframe.css"/>
		<?php endif; ?>
	<?php endif; ?>
<?php endif; ?>